<template>
  <div class="box">
    <div><slot name="leftother"></slot></div>
    <div><slot name="centerother"></slot></div>
    <div>
      <slot name="otherbutton"></slot>
      <el-button type="primary" size="small" @click="daochu" v-show="showexcel">
        <i class="el-icon-upload2">导出</i></el-button
      >
      <el-tooltip class="item" effect="dark" content="刷新" placement="top">
        <span @click="shuaxin" style="cursor: pointer">
          <i class="el-icon-refresh-right"></i
        ></span>
      </el-tooltip>
      <el-dropdown trigger="click" @command="command">
        <span class="el-dropdown-link">
          <el-tooltip class="item" effect="dark" content="密度" placement="top">
            <span style="cursor: pointer"><i class="el-icon-d-caret"></i></span>
          </el-tooltip>
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item command="medium">默认</el-dropdown-item>
          <el-dropdown-item command="small">中等</el-dropdown-item>
          <el-dropdown-item command="mini">紧凑</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CallPoliceIndex',
  props: {
    showexcel: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {}
  },

  mounted() {},

  methods: {
    daochu() {
      this.$emit('daochu')
    },
    shuaxin() {
      this.$emit('shuaxin')
      // this.$message.success('列表刷新成功')
    },
    command(val) {
      this.$emit('command', val)
    }
  }
}
</script>

<style lang="scss" scoped>
.box {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  .daochu {
    width: 60px;
    height: 30px;
    color: #fff;
    background-color: #1890ff;
    border: none;
    border-radius: 3px;
  }
}
.item {
  margin-left: 10px;
}
</style>
